//
//  CNLandmark.swift
//  SwiftUi
//
//  Created by xm on 29/08/2025.
//

import Foundation
import MapKit
import SwiftUI

struct CNLandmark: Identifiable {
    var id: Int
    var category: String
    var name: String
    var city: String
    var province: String
    
    var latitude: Double
    var longtitude: Double
    
    var locationCoordinate: CLLocationCoordinate2D {
        CLLocationCoordinate2D(latitude: latitude, longitude:longtitude)
    }
    
    var imageName: String
    var isFevorite: Bool
    var isFeatured: Bool
    var image:Image  {
        Image(imageName)
    }
    
    
    
}

// Landmark(id: 2, category: “现代建筑”, name:“东方明珠"city:“上海", province:“上海市":latitude:31.2396935,longitude: 121.4975613, imageName: "dongfangmingzhu", isFavorite: false, isFeatured:true)


let CN_landmarks = [
    CNLandmark(id: 1, category:"古迹", name:"天安门", city:"北京",province:"北京市", latitude: 39.9087243, longtitude:116.3952859, imageName:"b1", isFevorite: true, isFeatured: true),
    CNLandmark(id: 2, category:"现代建筑", name:"东方明珠", city:"上海", province:"上海市", latitude:31.2396935,longtitude: 121.4975613, imageName: "b2", isFevorite: false, isFeatured:true),
    CNLandmark(id: 3, category:"现代建筑", name:"广州塔", city:"广州", province:"广东省", latitude: 23.1057327, longtitude: 113.3212248, imageName: "b3", isFevorite:true, isFeatured: false),
    CNLandmark(id: 4, category:"现代建筑", name:"金融中心", city:"深圳", province:"广东省", latitude:22.5252475,longtitude: 114.0496064, imageName: "b4", isFevorite: false, isFeatured: false),
    CNLandmark(id:5, category:"现代建筑",name:"天际线", city:"香港", province:"香港特别行政区", latitude:22.3002824,longtitude: 114.1552779, imageName: "b5",isFevorite: true, isFeatured: false),
    CNLandmark(id: 6, category:"自然景观", name:"九寨沟", city:"九寨沟县", province:"四川省", latitude: 33.0662381, longtitude: 103.6868964,imageName:"b6", isFevorite:true, isFeatured: true),
    CNLandmark(id:7, category: "自然景观", name:"日月潭",city:"南投县", province:"台湾", latitude:23.8563226,longtitude: 120.9145103,imageName: "b7", isFevorite: false, isFeatured:true),
    CNLandmark(id: 8, category:"自然景观", name:"西湖", city:"杭州", province:"浙江省", latitude:30.2430439,longtitude: 120.1258988, imageName:"b8", isFevorite: false, isFeatured: false),
    CNLandmark(id:9, category:"古迹", name:"布达拉宫", city:"拉萨",province:"西藏自治区", latitude: 29.6554988,longtitude: 91.1163852, imageName: "b9", isFevorite: false, isFeatured: false),
    CNLandmark(id: 10, category:"古迹", name:"中山陵", city:"南京", province:"江苏省", latitude:32.9605805, longtitude: 118.8480227, imageName: "b10", isFevorite: false, isFeatured: false),
    
    
]

let featuredLandmarks = CN_landmarks.filter{$0.isFeatured}
